﻿using FarmerJoe.Helpers.Logging;
using Styx;
using Styx.Common;
using Styx.TreeSharp;

namespace FarmerJoe
{
    partial class Base
    {
        private Composite _combatBehavior;

        public override Composite CombatBehavior
        {
            get
            {
                if (_combatBehavior == null)
                {
                    Log.Write(LogLevel.Verbose,"Creating 'Combat' behavior");
                    
                    _combatBehavior = CreateCombatBehaviors();
                    if (_combatBehavior == null)
                    {
                        Log.Write("No combat routine is available for your class, " + Me.Class);
                    }
                }
                return _combatBehavior;
            }
        }

        private Composite CreateCombatBehaviors()
        {
            switch (Me.Class)
            {
                case WoWClass.Warlock:
                    return Classes.Warlock.CombatBehavior_SpecSwitch();

                case WoWClass.Druid:
                    return Classes.Druid.CombatBehavior_SpecSwitch();

                case WoWClass.Priest:
                    return Classes.Priest.CombatBehavior_SpecSwitch();

                case WoWClass.Hunter:
                    return Classes.Hunter.CombatBehavior_SpecSwitch();

                case WoWClass.Monk:
                    break;
                    //return Classes.Monk.CombatBehavior_SpecSwitch();

            }

            return null;
        }
    }
}
